var mongoose = require('../common/db');

// 数据库模板
var recommend = new mongoose.Schema({
	recommendImg: String,
	recommendSrc: String,
	recommendTitle: String,
});

// 通过ID获得主页推荐
recommend.statics.findByIndexId = function (m_id, callBack) {
	this.find({ findByIndexId: m_id }, callBack);
};

// 找到所有的推荐
recommend.statics.findAll = function (callBack) {
	this.find({}, callBack);
};

var recommendModel = mongoose.model('Recommend', recommend);

module.exports = recommendModel;
